document.getElementById('addBtn').onclick = function(){
    location.href = '/add'
}

function confirmDelete(id){

   let result = layer.confirm('确认永久删除吗，数据不可还原', {
        btn: ['是的', '取消'], //按钮
        shadeClose: true,
        shade: [0.3, '#000']
    },()=>{
        //点了是的按钮触发
        location.href="/delete?id="+id
    },()=>{
        layer.msg('你取消')
    });

   
}